#coding=utf-8
import os
from elixir import *

from finstrument import *
from tradeday import *
from fundamental import *

from config import ROOTDIR

db = os.path.join(ROOTDIR, 'data', 'pytrader.sqlite')
metadata.bind = "sqlite:///%s"%db
metadata.bind.echo = True

setup_all(True)

def find_stock(code):
    return Stock.query().filter_by(code=code).one()
